/**
 * 延迟执行函数
 * @param {number} ms - 延迟的毫秒数
 * @returns {Promise<void>} - 延迟Promise
 */
export function delay(ms) {
    if (typeof ms !== 'number' || ms < 0) {
        throw new TypeError('ms must be a non-negative number');
    }

    return new Promise(resolve => {
        setTimeout(resolve, ms);
    });
}

// 默认导出
export default delay;